package com.gitee.mars.vaccin.controller;

import com.gitee.mars.vaccin.request.VaccinNameRequest;
import com.gitee.mars.vaccin.response.result.R;
import org.springframework.web.bind.annotation.*;
import lombok.AllArgsConstructor;

import java.util.Arrays;

import com.gitee.mars.vaccin.entity.VaccinType;
import com.gitee.mars.vaccin.service.IVaccinTypeService;

/**
 * VaccinType 控制层
 *
 * @Author wq
 * @Date 2021-04-11
 **/
@RestController
@RequestMapping("/vaccinType")
@AllArgsConstructor
public class
VaccinTypeController {

    private final IVaccinTypeService vaccinTypeService;

    /**
     * 列表
     *
     * @param req req
     * @return R
     */
    @PostMapping("/list")
    public R list(@RequestBody VaccinNameRequest req) {
        return R.success(vaccinTypeService.list(req));
    }

    /**
     * 添加
     *
     * @param req req
     * @return R
     */
    @PostMapping("/add")
    public R add(@RequestBody VaccinNameRequest req) {
        vaccinTypeService.add(req);
        return R.success();
    }


}